{extend name="layout/detail" /}
{block name="content"}
<input id="ajax" value="1" type="hidden">
<div class="layui-tab td-tab-1 no-margin">
    <ul class="layui-tab-title">
        <a href="//">
            <li class="layui-this">系统设置</li>
        </a>
        <a href="//">
            <li onclick="qiniu()">七牛云</li>
        </a>
        <a href="//">
            <li onclick="weixin()">微信</li>
        </a>
        <a href="//">
            <li onclick="zhifubao()">支付宝</li>
        </a>
    </ul>
</div>
<div class="td-content-wrap no-margin p20">
    <div class="space-20"></div>
    <form id="form_data" class="layui-form" method="post" action="{:url('save')}">
        <input type="hidden" name="data_type" value="system">
        <div class="layui-form-item">
            <label class="layui-form-label">系统名称：</label>
            <div class="layui-input-block w40">
                <input type="text" class="layui-input" id="system_name" name="system_name" check="required"
                    info="请输入系统名称" value="{$system_data.system_name|default=''}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">网址：</label>
            <div class="layui-input-block w40">
                <input type="text" class="layui-input" name="system_url" check="required"
                    value="{$system_data.system_url|default=''}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">LOGO：</label>
            <div class="layui-input-block">
                <div class="image-upload">
                    <div class="input">
                        <input type="hidden" class="image-url" name="system_logo"
                            value="{$system_data.system_logo|default=''}">
                    </div>
                    <div class="image-upload-btn">
                        上传图片
                    </div>
                    <div class="image">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">订单佣金比例：</label>
                <div class="layui-input-inline w40">
                    <input type="number" class="layui-input" name="bank" check="required"
                        value="{$system_data.system_commission|default=''}">
                </div>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" name="" check="required" value="%" readonly
                        style="border: 0px;">
                </div>
            </div>
        </div>
        <hr>
        <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <div class="layui-input-block">
                <a class="layui-btn" onclick="save();">保存</a>
                <a class="layui-btn layui-btn-primary" onclick="go_return_url();">取消</a>
            </div>
        </div>
    </form>
</div>
{/block}

{block name="script"}
<script>
    layui.use(['common', 'element', 'uploader'], function () {
        set_return_url(null);

        var fn = {
            save: function () {
                send_form("form_data", "{:url('save')}", function (res) {
                    if (res.code) {
                        layer.msg(res.msg, {
                            time: 1200
                        }, function () {
                            location.reload(true);
                        });
                    } else {
                        layer.msg(res.msg);
                        return false;
                    }
                });
            }
        };

        win_exp(fn);
    });
</script>
{/block}